/**
 * 返回给前端的服务处理状态
 */
package com.cnfangmao.common.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;


@JsonInclude(value = Include.NON_EMPTY)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ResultVO {
	
	@JsonProperty("status")
	private int Status=HttpResult.RESULT_SUCCESS;  //服务处理结果
	
	@JsonProperty("msg")
	private String Msg="";  //处理结果消息，一般指错误信息

	@JsonProperty("processor")
	private Object Proessor=null;  //如果当前请求出错，返回出错处理地址 前端结构为url:网页地址
	
	@JsonProperty("result")
	private Object Result=null;  //处理结果对象
	
	public ResultVO()
	{
		
	}
	
	public ResultVO(int status,String msg,String processor,Object result)
	{
		this.Status=status;
		this.Msg=msg;
		this.Result=result;
		this.Proessor=processor;
	}
	
	@JsonProperty("status")
	public int getStatus() {
		return Status;
	}
	
	public void setStatus(int status) {
		this.Status = status;
	}
	
	@JsonProperty("msg")	
	public String getMsg() {
		return this.Msg;
	}
	
	public void setMsg(String msg) {
		this.Msg = msg;
	}
	
	@JsonProperty("result")	
	public Object getResult() {
		return Result;
	}
	
	public void setResult(Object result) {
		this.Result = result;
	}


	@JsonProperty("processor")	
	public Object getProessor() {
		return Proessor;
	}

	public void setProessor(Object proessor) {
		Proessor = proessor;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((Msg == null) ? 0 : Msg.hashCode());
		result = prime * result + ((Proessor == null) ? 0 : Proessor.hashCode());
		result = prime * result + ((Result == null) ? 0 : Result.hashCode());
		result = prime * result + Status;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ResultVO other = (ResultVO) obj;
		if (Msg == null) {
			if (other.Msg != null)
				return false;
		} else if (!Msg.equals(other.Msg))
			return false;
		if (Proessor == null) {
			if (other.Proessor != null)
				return false;
		} else if (!Proessor.equals(other.Proessor))
			return false;
		if (Result == null) {
			if (other.Result != null)
				return false;
		} else if (!Result.equals(other.Result))
			return false;
		if (Status != other.Status)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ResultVO [Status=" + Status + ", Msg=" + Msg + ", Proessor=" + Proessor + ", Result=" + Result + "]";
	}
}
